/* 配置文件,之后的中间件需要在config/index.js中进行配置 */
const router = require('../routers');
const koaBody = require("koa-body");
const static = require("koa-static");

const path = require("path")
const render = require('koa-art-template');
function initProject(app){
    app.use(koaBody());
    app.use(router.routes());
    // var res = path.join(process.cwd(),'static')
    // console.log(res);
    app.use(static(path.join(process.cwd(),'static')))
    render(app, {
        root: path.join(process.cwd(), 'pages'),
        extname: '.html',
        debug: process.env.NODE_ENV !== 'production'
      });
}
module.exports = initProject;